<template>
  <div>
    <!-- 全部打开：default-expand-all -->
    <el-table
      :data="tableData"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    >
      <el-table-column prop="uid" label="UID"  width="300px"></el-table-column>
      <el-table-column prop="nickname" label="昵称"></el-table-column>
      <el-table-column prop="phone" label="手机号"></el-table-column>
      <el-table-column prop="addtime" label="注册日期" width="200px">
        <template slot-scope="scope">
          {{scope.row.addtime|toTime}}
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            type="primary"
            icon="el-icon-edit"
            circle
            size="mini"
            @click="edit(scope.row.id)"
          ></el-button>
          <el-button
            type="danger"
            icon="el-icon-delete"
            circle
            size="mini"
            @click="del(scope.row.id)"
          ></el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog :title="'商品分类'" :visible.sync="dialogVisible" width="45%">
      <member-info></member-info>
      <span slot="footer" class="dialog-footer">
        <el-button size="medium" @click="dialogVisible = false">取 消</el-button>
        <el-button type="danger" size="medium" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import memberInfo from "./info";
import { getNemberList  } from "../../request";
export default {
  data() {
    return {
      tableData: [],
      dialogVisible: false,
      // popType: "新增",
      // transData: [],
      // currentPage: 1,
      // pageSize: 2,
      // total: 0
    };
  },
  components: {
    memberInfo
  },
  created() {
    // 获取会员列表
    this.getData();
  },
  methods: {
    //获取会员列表
    async getData() {
      let res = await getNemberList();
      this.tableData = res;
    },
    async edit(id) {
    //   this.popType = "修改";
    //   let res = await getSpecsAttr(id);
    //   this.transData.id=id;
    //   this.transData = res[0];
    //   this.dialogVisible = true;
    },
    del(id) {
    //   this.$confirm("确认删除吗,是否继续?", "提示", {
    //     confirmButtonText: "确定",
    //     cancelButtonText: "取消",
    //     type: "warning",
    //     confirmButtonClass: "el-button--danger"
    //   })
    //     .then(res => {
    //       this.doDel(id);
    //     })
    //     .catch(_ => {});
    },
    doDel(id) {
    //   this.$http.post("/specsdelete", { id }).then(res => {
    //     this.tableData = res.data.list;
    //   });
    },
    // 当前页
    // handleCurrentChange(val) {
    //   this.getData();
    // }
  }
};
</script>
<style lang="" >
.el-button {
  margin-bottom: 10px;
}
.el-pagination__total {
  float: right;
}
.el-tag{
  margin-left: 3px;
}
</style>